#!/bin/python3
# -*- coding:utf-8 -*-
"""
    微服务API模板
    Add By :陈狍子 e4ting@qq.com
"""
from flask_restful import Api,Resource

from app.flaskapp import webapp
from e4ting       import log
api = Api(webapp)


from v4.wx.robot import WebWXBot
api.add_resource(WebWXBot,
    "/api/v4/wx/robot",
    "/api/v4/wx/robot/<string:id>",
    )
log.info(""" /api/v4/wx/robot  /api/v4/wx/robot/<string:id>  WebWXBot""")

from v4.robot.types import WebRobotTypes
api.add_resource(WebRobotTypes,
    "/api/v4/robot/types",
    "/api/v4/robot/types/<string:id>",
    )
log.info(""" /api/v4/robot/types  /api/v4/robot/types/<string:id>  WebRobotTypes""")

from v4.robot.webhook import WebHooks
api.add_resource(WebHooks,
    "/api/v4/robot/webhook",
    "/api/v4/robot/webhook/<string:id>",
    )
log.info(""" /api/v4/robot/webhook  /api/v4/robot/webhook/<string:id>  WebHooks""")

from v4.robot.template import WebTemplates
api.add_resource(WebTemplates,
    "/api/v4/robot/template",
    "/api/v4/robot/template/<string:id>",
    )
log.info(""" /api/v4/robot/template  /api/v4/robot/template/<string:id>  WebTemplates""")

from v4.robot.robot import WebRobots
api.add_resource(WebRobots,
    "/api/v4/robot/robot",
    "/api/v4/robot/robot/<string:id>",
    )
log.info(""" /api/v4/robot/robot  /api/v4/robot/robot/<string:id>  WebRobots""")

from v4.robot.events import WebEventTypes
api.add_resource(WebEventTypes,
    "/api/v4/robot/events",
    "/api/v4/robot/events/<string:id>",
    )
log.info(""" /api/v4/robot/events  /api/v4/robot/events/<string:id>  WebEventTypes""")

from v4.cluster.list import WebListBots
api.add_resource(WebListBots,
    "/api/v4/cluster/list",
    "/api/v4/cluster/list/<string:id>",
    )
log.info(""" /api/v4/cluster/list  /api/v4/cluster/list/<string:id>  WebListBots""")

from v4.cluster.detail import WebBotDetail
api.add_resource(WebBotDetail,
    "/api/v4/cluster/detail",
    "/api/v4/cluster/detail/<string:id>",
    )
log.info(""" /api/v4/cluster/detail  /api/v4/cluster/detail/<string:id>  WebBotDetail""")

from v4.cluster.info import WebBotnetInfo
api.add_resource(WebBotnetInfo,
    "/api/v4/cluster/info",
    "/api/v4/cluster/info/<string:id>",
    )
log.info(""" /api/v4/cluster/info  /api/v4/cluster/info/<string:id>  WebBotnetInfo""")

from v4.cluster.control import WebBotControl
api.add_resource(WebBotControl,
    "/api/v4/cluster/control",
    "/api/v4/cluster/control/<string:id>",
    )
log.info(""" /api/v4/cluster/control  /api/v4/cluster/control/<string:id>  WebBotControl""")

